{$mode delphi}
program Check;

{$APPTYPE CONSOLE}

uses
  TestLib, SysUtils;

var
  testNum, n, i: longint;
  jury_ans, stud_ans: int64;

begin
  inf.readWord([' ','	',#13, #10], [' ','	',#13, #10]);
  testNum := inf.readLongint();
  n := inf.readLongint();

  for i := 1 to testNum - 1 do
    ans.readLongLong();
  jury_ans := ans.readLongLong();

  for i := 1 to testNum - 1 do
    ouf.readword([' ', #13, #10, #9], [' ', #13, #10, #9]);
  stud_ans := ouf.readLongLong();

  if stud_ans <> jury_ans then begin
    //writeln(Format('%d expected, but %d found',[jury_ans, stud_ans]));
    quit (_WA, Format('%d expected, but %d found',[jury_ans, stud_ans]));
  end;
  while not ouf.seekEof() do
    ouf.readword([' ', #13, #10, #9], [' ', #13, #10, #9]);
  quit(_OK, Format('Output = %d',[stud_ans]));
end.
